home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / os20 / util / hackdisk202.lha / hackdisk.doc < prev    next >
Text File  |  1993-04-04  |  7KB  |  190 lines

  1. Hackdisk V2.02
  2.  
  3. By Dan Babcock
  4. Copyright (C) 1992,93 by Dan Babcock
  5.  
  6. ------------
  7. Distribution
  8. ------------
  9.  
  10. Hackdisk may be freely copied for non-commercial purposes (only).
  11.  
  12. -----------------
  13. What is Hackdisk?
  14. -----------------
  15.  
  16. Hackdisk is a complete trackdisk.device replacement (although
  17. note that the support code for 5.25 inch drives has not been
  18. tested). Support for 150RPM drives is new for V2. It works with
  19. any version of Kickstart (tested with 1.3, 2.04, and various 3.0
  20. betas).
  21.  
  22. ----------------------------
  23. What's wrong with trackdisk?
  24. ----------------------------
  25.  
  26. The standard trackdisk module works well, but it isn't perfect.
  27. My major gripe is that it doesn't offer a verify option. I used
  28. TrackSalve (a brilliant program by Dirk Reisig) before KS2.0 and
  29. received enough "verify error" messages to realize that this
  30. feature is very valuable. Hackdisk has a verify option that may
  31. be turned on or off at any time for any drive. The verify is very
  32. efficient and compares the raw MFM data bit-for-bit.
  33.  
  34. Hackdisk is faster than trackdisk 2.0. A DiskCopy to RAD: is 5
  35. seconds faster. A DiskCopy from RAD: with verify is only 1.6
  36. times slower than trackdisk, not 2 times slower like you might
  37. expect! Please note that this performance increase is gained by
  38. better programming, NOT by pushing the drive beyond its
  39. specifications.
  40.  
  41. Hackdisk requires more chip RAM for its verify buffer, but
  42. conserves memory by using one track buffer for all drives, rather
  43. than a track buffer for each drive. Experience shows that this
  44. does not hurt performance. Note: In V2, the size of chip RAM
  45. buffers has doubled to support high density drives. I decided not
  46. to dynamically adjust the buffer size for simplicity and to avoid
  47. dreaded memory fragmentation.
  48.  
  49. For programmers, Hackdisk eliminates the restrictions on
  50. read/write parameters. You can specify a read or write at any
  51. byte offset, any byte length, to/from any byte address.
  52.  
  53. -------------------
  54. Installing Hackdisk
  55. -------------------
  56.  
  57. This is where I'll probably lose most of my audience. :-)
  58.  
  59. Hackdisk is a true replacement for trackdisk.device (and is
  60. called trackdisk.device as well), not some kind of patch.
  61. (Contrary to its name, it isn't a hack at all!). This presents
  62. some difficulties, since you can't just run it from the CLI.
  63. Three major alternatives are available for installing Hackdisk:
  64.  
  65.  
  66. 1) Use the MakeRes utility (included) by Gunther Nikl.
  67.  
  68.  
  69. 2) Use the 'RamKick' utility. RamKick is a Commodore-written
  70. program to kick in an alternative OS module. It was distributed
  71. and used with V35 of the OS, which was designed to support the
  72. hires monochrome display (Hedley/Moniterm). Unfortunately, I
  73. can't distribute it with Hackdisk due to the unknown copyright
  74. status. (No copyright or author message is included in the code).
  75. Anyway, here are some hints for using RamKick:
  76.  
  77. Type "ramkick ?" to see the options. If you don't know what
  78. everything does, don't worry, because I don't either! Use the
  79. "Kick" script as an example. (Note: It doesn't matter where you
  80. put hackdisk.device, but DEVS: is a good place). The Kick script
  81. uses a tiny program called "HackDiskTest" to test whether
  82. Hackdisk is installed. It will also print out the version number
  83. and copyright. Therefore you can put this at the start of your
  84. startup-sequence to have Hackdisk loaded whenever needed. If you
  85. have an autobooting hard drive, it won't slow down booting much.
  86.  
  87. Sometimes after booting a game or demo the machine will enter a
  88. infinite reboot cycle. This is caused by RamKick or Hackdisk
  89. being partially (but not fully) corrupted. RamKick should perform
  90. more extensive checksums...
  91.  
  92. 68040 users: RamKick must be patched to call _LVOColdReboot
  93. rather than using its own (rather crude) reset method. This is
  94. quite simple to do. If you need help, email me.
  95.  
  96.  
  97. 3) Replace trackdisk.device directly in the ROM. There are many
  98. variations to this. The brute force method is to burn a new
  99. kickstart EPROM. A more viable option for those with 030/040
  100. cards is to use special software to boot up with an alternative
  101. kickstart ROM image (soft-kicked A3000s have this ability built-
  102. in). For '030 users, I believe SetCPU by Dave Haynie has such an
  103. option. I use SetFF, which is the all-purpose control utility
  104. supplied with the Fusion 40 (68040) card. OK, assuming you have
  105. the magic utility in hand that is compatible with your hardware,
  106. how does one modify the kickstart image appropriately?
  107. Unfortunately, this is going to take quite a bit of technical
  108. knowledge. I'll blithely assume you can handle it and continue:
  109.  
  110. a) Locate the starting address of trackdisk.device in the ROM.
  111. You should see "trackdisk" and some kind of date/version string.
  112. Look backwards from that for a $4AFC. That address in the very
  113. beginning of the trackdisk module. Note: An easier method is to
  114. use the E option of Xoper.
  115.  
  116. b) Either reassemble (use Macro68) Hackdisk at this absolute
  117. address or use the 'HunkWiz' utility by Christian A. Weber (you
  118. can find this utility in the BeerMon distribution) to generate
  119. the absolute-address version.
  120.  
  121. c) Insert the absolute-address Hackdisk at the proper place in
  122. the kickstart image (use the monitor of your choice...I like Mon
  123. by Timo Rossi).
  124.  
  125. d) Calculate the new ROM checksum. Sadly, I don't have a nice
  126. program prepared to do this. Here is roughly the code required
  127. (for 512K ROMs):
  128.  
  129.     MOVE.L    #$300000,A0    ;starting address of ROM image
  130. ;    MOVE.L    #$300008,A1    ;if you want to preserve old value
  131.     MOVE.L    #$37FFE8,A1    ;address of magic checksum longword
  132.     CLR.L     (A1)
  133.     MOVE.L    #$1ffff,D1
  134.     MOVEQ     #0,D0
  135. 1$:    ADD.L     (A0)+,D0
  136.     BCC.S     2$
  137.     ADDQ.L    #1,D0
  138. 2$:    DBRA        D1,1$
  139.     SUB.L    #$10000,D1
  140.     BPL.S    1$
  141.     NOT.L    D0
  142.     MOVE.L    D0,(A1)
  143.     RTS
  144.  
  145. e) If you've made it this far, congratulations. You're ready to
  146. boot with the custom kickstart.
  147.  
  148. -------------------------
  149. Turning Verify Off and On
  150. -------------------------
  151.  
  152. By default, verify is ON for all drives. You can use my QMouse
  153. utility (public domain, on a Fish disk) to change the verify
  154. state, if desired.
  155.  
  156. Programmers: The verify bit is bit 1 of TDU_PUBFLAGS.
  157.  
  158.  
  159. -----
  160. Bugs?
  161. -----
  162.  
  163. Hackdisk is 3,000 lines of assembly and a fairly intricate piece
  164. of code (see hackdisk.s) and pushes the hardware to the limit.
  165. Although I've tried my best, I only have three drives and one
  166. Amiga to test with. I can just hope it works as well for you as
  167. it does for me.
  168.  
  169. -------
  170. Credits
  171. -------
  172.  
  173. Special thanks go to the following genuine Amiga wizards:
  174.  
  175. Dirk Reisig        - for TrackSalve
  176. Sebastiano Vigna    - for SuperDuper
  177. Mike Schwartz        - for sharing his game kernel etc.
  178.  
  179. ------------------
  180. Author Information
  181. ------------------
  182.  
  183. I am reachable via Usenet as Dan_E_Babcock@cup.portal.com.
  184.  
  185. Other fine freeware software products by me:
  186.  
  187. QMouse - small & unique multi-purpose "mouse utility"
  188. FileMount - enables creation of true partitions (for e.g. AMAX)
  189. within files.
  190.